Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulling apart multiprocessing queue internals to fix the leftover FDs issue #15

Merged
merged 6 commits into from
Dec 12, 2013

Conversation

gatoatigrado
Copy link
Owner

I made the old closes-fds test run 30 times, by default, which seemed to consistently produce the flakiness we were seeing earlier. I then dug into multiprocessing.queue internals, and found the pipes it was using which weren't closed. I then manually closed them. See #14 for details.

if v(fd_stat.st_mode)]
return FDInfo(
modes=[k for k, v in readable_mode_strings.items() if v(fd_stat.st_mode)],
symlink=os.readlink("/proc/{0}/fd/{1}".format(os.getpid(), fd_number)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look portable (I know this won't work on OS X, for example).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest version -- I re-added the older version which scans for FDs, currently from 3 to 30 (tested manually by changing "/proc" to "/proc2")

@blampe
Copy link
Contributor

blampe commented Dec 12, 2013

Ship it!

gatoatigrado added a commit that referenced this pull request Dec 12, 2013
pulling apart multiprocessing queue internals to fix the leftover FDs issue
@gatoatigrado gatoatigrado merged commit e2cbb8c into master Dec 12, 2013
@gatoatigrado gatoatigrado deleted the ntung-closes-fds-fix-2 branch January 2, 2014 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants